clear;clc;
%% device connection

obj1 = instrfind('Type', 'serial', 'Port', 'COM3', 'Tag', '');
if isempty(obj1)
obj1 = serial('COM3');
else
fclose(obj1);
obj1 = obj1(1);
end
fopen(obj1);
set(obj1, 'Terminator', {'CR','CR'});

%% fetch data
[flsobit, data] = fetchSR785(obj1);